<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<script
	src="${pageContext.request.contextPath}/resources/js/Lead/Create.js"></script>
<div id="content" class="span10">
	<!-- content starts -->

	<div>
		<ul class="breadcrumb">
			<li><a href="#">Home</a> <span class="divider">/</span></li>
			<li><a href="#">Leads</a> <span class="divider">/</span></li>
			<li><a href="#">Convert Lead</a></li>
		</ul>
	</div>

	<div class="row-fluid sortable">
		<div class="box span12">
			<div class="box-header well" data-original-title>
				<h2>
					Convert Lead
				</h2>
				<div class="box-icon">
					<a href="#" class="btn btn-minimize btn-round"><i
						class="icon-chevron-up"></i></a>
				</div>
			</div>
			<div class="box-content">

				<div id="formsContent">
					<!-- Form container -->
					<form:form id="leadForm" commandName="leadDTO"
						class="form-horizontal" autocomplete="off" method="POST" action="">
						<div class="row-fluid">
							<div class="span12">
								<fieldset>
									<legend>
										Account Information
									</legend>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Account Owner <span style="color: red;">*</span></label>
												<div class="controls">
													<form:input path="accountOwner" id="accountOwner" name="accountOwner" value=""
														maxlength="100" placeholder="" class="required" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Account Name <span style="color: red;">*</span></label>
												<div class="controls">
													<form:input path="accountName" id="accountName"
														name="accountName" value="" maxlength="100" placeholder=""
														class="required" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Converted Status</label>
												<div class="controls">
													<form:select path="convertedStatus">
							                        <c:forEach items="${leadStatus}" varStatus="leadStat">
							                        	<c:choose>
							                        		<c:when test="${leadStatus[leadStat.index].name == lead.leadStatus}">
							                        			<form:option value="${leadStat.index}">${leadStatus[leadStat.index].name}</form:option>
							                        		</c:when>
							                        		<c:otherwise>
							                        			<form:option value="${leadStat.index}">${leadStatus[leadStat.index].name}</form:option>
							                        		</c:otherwise>
							                        	</c:choose>
							                            
							                        </c:forEach>
							                        </form:select>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>				
									</div>
								</fieldset>

								<fieldset>
									<legend>
										Additional Information
									</legend>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Subject</label>
												<div class="controls">
													<form:input path="subject" id="subject" name="subject" value=""
														maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Date</label>
												<div class="controls">
													<form:input path="datepicker" id="datepicker" name="datepicker" value=""
														maxlength="100" placeholder="" />
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span12 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Comments <span style="color: red;">*</span></label>
												<div class="controls">
													<form:textarea path="comments" rows="5"
														class="span12" id="comments" name="comments"></form:textarea>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
									<div class="row-fluid">
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Status </label>
												<div class="controls">
													<form:select  path="status">
							                            <c:forEach items="${status}" varStatus="stat">
								                        	<form:option value="${stat.index}">${status[stat.index].name}</form:option>
								                        </c:forEach>
													</form:select>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
										<div class="span6 bgcolor">
											<div class="control-group">
												<label class="control-label" for="input">Priority </label>
												<div class="controls">
													<form:select path="priority">
								                        <c:forEach items="${priorities}" varStatus="priority">
								                        	<form:option value="${priority.index}">${priorities[priority.index].name}</form:option>
								                        </c:forEach>
							           				</form:select>
													<label><span class="help-inline"></span></label>
												</div>
											</div>
										</div>
									</div>
								</fieldset>
							</div>
						</div>
						<div class="form-actions">
							<button id="saveButton" type="submit" class="btn btn-primary">
								Convert Lead
							</button>
							<button id="cancelButton" type="button" class="btn">
								<fmt:message key="form.cancel" />
							</button>
						</div>
					</form:form>
				</div>
			</div>
		</div>
		<!--/span-->

	</div>
	<!--/row-->

	<input type="hidden" name="fNameRequired" id="fNameRequired"
		value="<fmt:message key="error.lead.fName"/>" /> <input type="hidden"
		name="companyRequired" id="companyRequired"
		value="<fmt:message key="error.lead.company"/>" /> <input
		type="hidden" name="companyChecked" id="companyChecked"
		value="<fmt:message key="error.lead.checkCompany"/>" /> <input
		type="hidden" name="phoneRequired" id="phoneRequired"
		value="<fmt:message key="error.lead.phone"/>" /> <input type="hidden"
		name="phoneChecked" id="phoneChecked"
		value="<fmt:message key="error.lead.phoneChecked"/>" /> <input
		type="hidden" name="emailEmail" id="emailEmail"
		value="<fmt:message key="error.lead.emailPattern"/>" />
	<!-- content ends -->
</div>
<!--/#content.span10-->
<hr />